package com.jsoft.model;

import com.jsoft.model.core.BaseDao;

import javax.persistence.*;
import java.util.List;

/**
 * Date: 06.09.13
 * Time: 12:34
 */

@Entity
@Table(name = "order_items")
public class OrderItemDao extends BaseDao {
    @Column(name = "comment")
    private String comment;
    @Column(name = "count")
    private Integer count;
    @ManyToOne
    @JoinColumn(name = "menu_item_id")
    private MenuItemDao menuItem;
    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "order_item_dis_marg",
            joinColumns = @JoinColumn(name = "order_id"),
            inverseJoinColumns = @JoinColumn(name = "dismarg_id")
    )
    private List<DiscountMarginDao> disMargList;
    @Column(name = "status")
    private Integer status;

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public MenuItemDao getMenuItem() {
        return menuItem;
    }

    public void setMenuItem(MenuItemDao menuItem) {
        this.menuItem = menuItem;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public List<DiscountMarginDao> getDisMargList() {
        return disMargList;
    }

    public void setDisMargList(List<DiscountMarginDao> disMargList) {
        this.disMargList = disMargList;
    }
}